package com.hsgene.common.util.feign;

import feign.RequestInterceptor;
import feign.RequestTemplate;

/**
 * @author wangbing
 * @version 1.0, 2018/11/12
 */
public class FeignRequestInterceptor implements RequestInterceptor {

    public final static String FEIGN_CLIENT = "feign_client";

    @Override
    public void apply(RequestTemplate requestTemplate) {
        if (!requestTemplate.headers().containsKey(FEIGN_CLIENT)) {
            requestTemplate.header(FEIGN_CLIENT, "feign_client");
        }
    }
}
